<template>
    <lay-container fluid="true" style="padding: 10px">
        <lay-row :space="10">
            <lay-col :md="24">
                <lay-tree :data="treeData" collapse-transition @node-click="handleClick" class="layui-tree-txtss"
                    :onlyIconControl="true">
                </lay-tree>
            </lay-col>
        </lay-row>
    </lay-container>
</template>
    
<script name="CmsCateMenu" lang="ts" setup>
import { ref, } from "vue";
import { getCateTree } from "../../api/module/content/category";
import { useRouter } from "vue-router";
const treeData = ref([])
const router = useRouter();

getCateTree().then((res) => {
    if (res.status == 1) {
        treeData.value = res.data.data
    }
})

function handleClick(node: any) {
    router.push({ path: '/cms/content/list', query: { Cid: node.id } })
}
</script>
<style scoped>
</style>